<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>个人资料--layui后台管理模板 2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <script>
        ctx = "${ctxPath!}";
    </script>
    <link href="${ctxPath!}/layui/css/layui.css" rel="stylesheet" type="text/css">

</head>
<body class="childrenBody">
<div style="padding:10px 50px 10px 10px">
    <form id="featureForm" method="post" action="${ctxPath!}/console/feature/edit" class="layui-form">
        <div style="margin-bottom:20px;font-size:14px;border-bottom:1px solid #ccc; padding-bottom: 5px;">特征信息</div>
        <input type="hidden" name="id" value="${feature.id}"/>
        <div class="layui-form-item">
            <label class="layui-form-label">特征名称</label>
            <div class="layui-input-block">
                <input class="layui-input" type="text" name="name" value="${feature.name!}" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button id="submitButton" class="layui-btn" lay-submit lay-filter="*">保存</button>
                <button type="button" class="layui-btn layui-btn-primary" onclick="closeAll()">取消</button>
            </div>
        </div>
    </form>
</div>
<script src="${ctxPath!}/jquery/jquery.min.js"></script>
<script src="${ctxPath!}/layui/layui.js"></script>
<script src="${ctxPath!}/jqgrid/jquery.jqGrid.minffe4.js?0820"></script>
<script src="${ctxPath!}/jqgrid/myjqGrid.js?v=1.0.1"></script>
<script>
    layui.use(['form','layer'], function(){
        var form = layui.form;
        var layer=layui.layer;
        form.on('submit(*)', function(data){
            index = layer.load(0);
            $.post($("#featureForm").attr("action"), $("#featureForm").serialize(), function(data){
                if(data.status == 200){
                    layer.alert(data.msg, {
                        icon: 1,
                        skin: 'layer-ext-moon'
                    },function () {
                        parent.myJqGrid.reloadGrid({});
                        parent.layer.closeAll();
                    });
                }else{
                    layer.alert(data.msg, {
                        icon: 2,
                        skin: 'layer-ext-moon'
                    });
                }
            });
            return false; //阻止表单跳转。
        });
    });
    function closeAll() {
        parent.layer.closeAll();
    }
</script>
</body>
</html>